package com.qsl.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qsl.common.result.Result;
import com.qsl.model.system.SysLoginLog;
import com.qsl.model.vo.SysLoginLogQueryVo;
import com.qsl.system.service.LoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "登录日志")
@RestController
@RequestMapping("/admin/system/sysLog")
public class SysLoginLogController {

    @Autowired
    private LoginLogService loginLogService;

    @ApiOperation("条件分页查询登录日志")
    @GetMapping("{page}/{limit}")
    public Result getLogin(@ApiParam("当前页码") @PathVariable Integer page
            , @PathVariable Integer limit, SysLoginLogQueryVo loginLog) {
        System.out.println(page + "==>" + limit + loginLog);
        IPage<SysLoginLog> pageModel = loginLogService.selectPage(page, limit, loginLog);

        return Result.ok(pageModel);
    }


}
